
@SuppressWarnings("rawtypes")
public class TElementoFloyd {
	public Comparable[][] distancias;
	public Comparable[][] vertices;
	
	public TElementoFloyd(Comparable[][] vertices, Comparable[][] distancias){
		this.distancias = distancias;
		this.vertices = vertices;
	}
	
	
	@SuppressWarnings("unchecked")
	public void matrizFloyd(Comparable[] vectorVertices){
		for (int k = 0; k < distancias.length; k++) {
			for (int i = 0; i < distancias.length; i++) {
				for (int j = 0; j < distancias.length; j++) {
					if ((i != k)&&(k != j)&&(i!=j)){
						if ((distancias[i][k].compareTo(Integer.MAX_VALUE) != 0)
								&&(distancias[k][j].compareTo(Integer.MAX_VALUE) != 0)){
							int costoIK = (Integer) distancias[i][k];
							int costoKJ = (Integer) distancias[k][j];
							int costoIJ = Integer.MAX_VALUE;
							if (distancias[i][j].compareTo(Integer.MAX_VALUE) != 0){
								costoIJ = (Integer) distancias[i][j]; 
							}
							if ((costoIK + costoKJ)<costoIJ){
								distancias[i][j] = costoIK + costoKJ; 
								vertices[i][j] = vectorVertices[k];
							}
						}
					}
				}
			}
		}
	}
	
}
